package cn.itcast.mq.config;

import org.springframework.amqp.core.*;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//消息持久化  交换机持久化 队列持久化 消息持久化
@Configuration
public class CommonConfig {
     //交换机持久化
     @Bean
     public DirectExchange simpleExchange() {
         return new DirectExchange("simple.direct",true,false);
     }
     //队列持久化
     @Bean
     public Queue simpleQueue() {
         return QueueBuilder.durable("simple.queue").build();
     }
}
